home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 November / 1987-11.d64 / poster printer (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  83 lines

  1. 10 rem copyright 1987 compute! publications, inc. - all rights reserved
  2. 20 ifpeek(65530)=5then(NULL)15
  3. 30 poke56,59:poke55,0:clr:ch=15360:dim b(8,8):open4,4,0:gosub740
  4. 40 bh=5:bw=3:rem banner pixel height (1-10) and width (1-)
  5. 50 pw=1:rem single-page pixel width (1-2)
  6. 60 print"[147]   copyright 1987 compute! pub., inc."
  7. 70 printtab(11)"all rights reserved"
  8. 80 printtab(11)"poster printer"
  9. 90 printtab(11)"1. banner"
  10. 100 printtab(11)"2. single page"
  11. 110 printtab(11)"3. form feed"
  12. 120 printtab(11)"4. exit program"
  13. 130 geta$:ifa$<"1"ora$>"4"then130
  14. 140 onasc(a$)-48goto170,410,150,160
  15. 150 print#4,chr$(12):goto60:rem form feed
  16. 160 print#4:close4:print"[147]":end
  17. 170 print"[147]please enter the message to";
  18. 180 a$="":print" be printed":inputa$:ifa$=""then60
  19. 190 lp=len(a$)
  20. 200 forc=1tolp:gosub210:next:goto60
  21. 210 x$=mid$(a$,c,1):sc=asc(x$)
  22. 220 gosub330:cs=ch+sc*8
  23. 230 fori=0to7:a(i)=peek(cs+i):next
  24. 240 forbi=7to0step-1
  25. 250 l1$=left$("                                    ",(80-8*bh)/2)
  26. 260 forby=7to0step-1:ifa(by)and2^bithen290
  27. 270 l1$=l1$+left$("          ",bh)
  28. 280 goto300
  29. 290 l1$=l1$+left$("**********",bh)
  30. 300 nextby
  31. 310 fora=1tobw:print#4,l1$:next
  32. 320 nextbi:return
  33. 330 ifsc<32thensc=128:return
  34. 340 ifsc<64thenreturn
  35. 350 ifsc<96thensc=sc-64:return
  36. 360 ifsc<128thensc=sc-32:return
  37. 370 ifsc<160thensc=128:return
  38. 380 ifsc<192thensc=sc-64:return
  39. 390 ifsc<255thensc=sc-128:return
  40. 400 sc=94:return
  41. 410 nc=8:ifpw=2thennc=4
  42. 420 print"[147]enter up to 5 lines with"nc"letters or"
  43. 430 print"less per line (carriage return to quit)"
  44. 440 fora=1to5:l1$="":print"enter line";a:inputl1$
  45. 450 ifa=1andl1$=""thena=5:next:goto60
  46. 460 ifl1$=""thena=5:next:goto480
  47. 470 l=a:l$(a)=left$(l1$,nc):next
  48. 480 w=12*l:w1=int((60-w)/2)+5
  49. 490 forw=1tow1:print#4:next
  50. 500 forx=1tol:gosub510:next:goto60
  51. 510 ll=len(l$(x)):forx1=1toll
  52. 520 w$=mid$(l$(x),x1,1):sc=asc(w$)
  53. 530 gosub330
  54. 540 cs=ch+sc*8
  55. 550 forx2=0to7:b(x1,x2)=peek(cs+x2)
  56. 560 nextx2,x1
  57. 570 lc=int((80-(ll*pw*8+ll*2))/2):rem ll*2 for # spaces between adjoining chars
  58. 580 pl$=""
  59. 590 iflc=0then610
  60. 600 forx1=1tolc:pl$=pl$+" ":next
  61. 610 sl$=pl$
  62. 620 forx2=0to7:forx1=1toll
  63. 630 forbi=7to0step-1
  64. 640 ifb(x1,x2)and2^bithen660
  65. 650 pl$=pl$+left$("  ",pw):goto670:rem pixel width in this line and next
  66. 660 pl$=pl$+left$("**",pw)
  67. 670 nextbi
  68. 680 pl$=pl$+"  ":rem # spaces between adjoining characters
  69. 690 nextx1
  70. 700 print#4,pl$
  71. 710 pl$=sl$
  72. 720 nextx2
  73. 730 fora=1to4:print#4:next:return:rem spaces between text lines
  74. 740 i=15104:rem locate uppercase in ram
  75. 750 reada:ifa=-1thensys15104:return
  76. 760 pokei,a:i=i+1:goto750
  77. 770 rem 64 character move routine
  78. 780 data 169,208,133,252,169,60,133,254,169,0
  79. 790 data 133,251,133,253,120,165,1,41,251,133
  80. 800 data 1,162,4,160,0,177,251,145,253,200
  81. 810 data 208,249,230,252,230,254,202,208,242,165
  82. 820 data 1,9,4,133,1,88,96,-1
  83.